package ru.ifmo.filemanager.filesystem.keylistener;

import ru.ifmo.filemanager.filesystem.Type;


public class KeyRequest
{		
	private final Type type;
	private final int keyCode;
	
	public KeyRequest(Type type, int keyCode) {
		super();
		this.type = type;
		this.keyCode = keyCode;
	}
	public Type getType() {
		return type;
	}
	public int getKeyCode() {
		return keyCode;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + keyCode;
		result = prime * result + ((type == null) ? 0 : type.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		KeyRequest other = (KeyRequest) obj;
		if (keyCode != other.keyCode)
			return false;
		if (type == null) {
			if (other.type != null)
				return false;
		} else if (!type.equals(other.type))
			return false;
		return true;
	}
}